package com.hc.springcache.controller;

import com.hc.springcache.service.RedisCacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: huangcheng
 * @CreateTime: 2023-09-14  11:40
 * @Description:
 * @Version: 1.0
 */
@RestController
public class RedisCacheController {
    @Autowired
    private RedisCacheService redisCacheService;

    @GetMapping("/cacheableTest")
    public String cacheableTest(){
        return redisCacheService.cacheableTest();
    }

    @GetMapping("/cacheputTest")
    public String cacheputTest(){
        return redisCacheService.cacheputTest();
    }

    @GetMapping("/cacheEvictTest")
    public String cacheEvictTest(){
        return redisCacheService.cacheEvictTest();
    }

    @GetMapping("/cacheTest")
    public String cacheTest(){
        return redisCacheService.cacheTest("李四");
    }
}
